package com.lqk.composite;

/**
 * @author lqk
 * @date 2021/12/6 16:03
 *
 * Component :这是组合中对象声明接口
 */
public abstract class OrganizationComponent {
    private String name; // 名字
    private String des; // 描述，说明

    public OrganizationComponent(String name, String des) {
        this.name = name;
        this.des = des;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }

    protected void add(OrganizationComponent organizationComponent){
        // 默认实现
        throw new UnsupportedOperationException();
    }
    protected void remove(OrganizationComponent organizationComponent){
        // 默认实现
        throw new UnsupportedOperationException();
    }
    // 打印方法，抽象, 子类都需要实现
    public abstract void print();
}
